package com.lagou.edu.support;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Map;

/**
 * TODO: bean定义信息，包括注解信息
 *
 * @Author: wuyijie
 * @Date: 2021/11/16 21:12
 */
public class BeanDefinition {

    private String beanName;
    /**
     * class对象
     * */
    private Class<?> clazz;

    /**
     * 类注解信息
     * */
    private Annotation[] clazzAnnotationArr;

    /**
     * 属性注解信息
     * */
    private Map<Field,Annotation[]> fieldAnnotationMap;

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public Class<?> getClazz() {
        return clazz;
    }

    public void setClazz(Class<?> clazz) {
        this.clazz = clazz;
    }

    public Annotation[] getClazzAnnotationArr() {
        return clazzAnnotationArr;
    }

    public void setClazzAnnotationArr(Annotation[] clazzAnnotationArr) {
        this.clazzAnnotationArr = clazzAnnotationArr;
    }

    public Map<Field, Annotation[]> getFieldAnnotationMap() {
        return fieldAnnotationMap;
    }

    public void setFieldAnnotationMap(Map<Field, Annotation[]> fieldAnnotationMap) {
        this.fieldAnnotationMap = fieldAnnotationMap;
    }

    @Override
    public String toString() {
        return "BeanDefinition{" +
                "beanName='" + beanName + '\'' +
                ", clazz=" + clazz +
                ", clazzAnnotationArr=" + Arrays.toString(clazzAnnotationArr) +
                ", fieldAnnotationMap=" + fieldAnnotationMap +
                '}';
    }
}
